package com.rq.demo.controller;

import android.os.Bundle;
import android.view.View;
import android.view.ViewParent;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.rq.base.ui.BaseController;
import com.rq.base.ui.CtrWatcher;
import com.rq.base.ui.impl.OnClick;
import com.rq.demo.R;

public class Fra2 extends BaseController implements View.OnClickListener {
    @Override
    public int getLayoutId() {
        return R.layout.fra_2;
    }

    @Override
    public void onViewCreated(Bundle savedInstanceState) {
        super.onViewCreated(savedInstanceState);
        setData2View(((LinearLayout) getView(R.id.pan_1)).getChildAt(0), this);
        setData2View(((LinearLayout) getView(R.id.pan_1)).getChildAt(1), this);
        setData2View(((LinearLayout) getView(R.id.pan_1)).getChildAt(2), this);
        setData2View(((LinearLayout) getView(R.id.pan_2)).getChildAt(0), this);
        setData2View(((LinearLayout) getView(R.id.pan_2)).getChildAt(1), this);
        setData2View(((LinearLayout) getView(R.id.pan_2)).getChildAt(2), this);
        setData2View(((LinearLayout) getView(R.id.pan_3)).getChildAt(0), this);
        setData2View(((LinearLayout) getView(R.id.pan_3)).getChildAt(1), this);
        setData2View(((LinearLayout) getView(R.id.pan_3)).getChildAt(2), this);
    }

    public static final String ACTION_INPUT_NUM = "input.num";

    @Override
    @OnClick({R.id.tv})
    public void onClick(View v) {
        if (v.getId() == R.id.tv) {
            finish();
        } else {
            CtrWatcher.get().post(ACTION_INPUT_NUM, v.getTag());
        }
    }
}
